package com.jeespring.atomikos.service.impl;

import com.jeespring.atomikos.accountdao.AccountDao;
import com.jeespring.atomikos.entity.Order;
import com.jeespring.atomikos.orderdao.OrderDao;
import com.jeespring.atomikos.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Autowired
    private AccountDao accountDao;

    @Transactional
    @Override
    public void submitOrder(){

        orderDao.insert();

//        int i = 10/0;

        accountDao.updateById();
    }
}
